<!-- directive:title 自动代码生成1.5版本 表格相关代码生成 -->
<!-- directive:breadcrumb 自动化1.5 -->
<div class="panel-body">
    <form name="MakeFrom">
        <style type="text/css">
            .makeTable15 input{ margin: 2px 0; padding: 0 10px;}
            .makeTable15 select{ margin: 2px 0; padding: 0 10px;}
            .makeTable15 *::-webkit-scrollbar { width: 15px; height: 15px; background-color: #F5F5F5; }
            .makeTable15 .makeTable15ListItem { background: antiquewhite; border: 1px solid red; margin: 10px; display: inline-table; }
            .makeTable15 .makeTable15List1 { height: 141px; background: #8BC34A; overflow-y: hidden; overflow-x: scroll; white-space: nowrap; border: 1px solid red; }
            .makeTable15 .makeTable15List1 .makeTable15ListItem {height: 112px;width: 324px; }
            .makeTable15 .makeTable15List2 { height: 200px; background: #8BC34A; overflow-y: hidden; overflow-x: scroll; white-space: nowrap; border: 1px solid red; }
            .makeTable15 .makeTable15List2 .makeTable15ListItem {height: 180px;width: 253px; }
            .makeTable15 .makeTable15List3 { height: 160px; background: #8BC34A; overflow-y: hidden; overflow-x: scroll; white-space: nowrap; border: 1px solid red; }
            .makeTable15 .makeTable15List3 .makeTable15ListItem {height: 130px;width: 253px; }
            .makeTable15 .makeTable15List4 { height: 230px; background: #8BC34A; overflow-y: hidden; overflow-x: scroll; white-space: nowrap; border: 1px solid red; }
            .makeTable15 .makeTable15List4 .makeTable15ListItem {height: 200px;width: 324px; }
            .makeTable15 .makeTable15List5 { height: 160px; background: #8BC34A; overflow-y: hidden; overflow-x: scroll; white-space: nowrap; border: 1px solid red; }
            .makeTable15 .makeTable15List5 .makeTable15ListItem {height: 130px;width: 253px; }
        </style>
        <div class="row">
            <div class="col-sm-8 makeTable15">
                <div style="background: #FFC107; border: 1px solid red;">
                    表格生成器@20190819版本@liuyp
                    <br />这是一个表格页面
                    <br />核心接口--URL <input type="text" placeholder="请输入" style="width:250px;" ng-model="fromObj.listApi.url">
                    <br />核心接口--接口名称 (请与接口协商) <input type="text" placeholder="请输入" style="width:250px;" ng-model="fromObj.listApi.api">
                    <br />页面标题--取面包屑最后一个
                    <br />面包屑-- (逗号分隔, 暂时没有跳转功能) <input type="text" placeholder="" style="width:400px;" ng-model="fromObj.listApi.breadcrumb">
                    <br />分页功能 -- 是否需要<input type="checkbox" ng-model="fromObj.listApi.pageSet">
                </div>
                tab生成<span style="color:#4CAF50;" title="添加" ng-click="addItem('tab')"> <i class="fa fa-plus"></i> </span>
                <div class="makeTable15List1">
                    <div class="makeTable15ListItem" ng-repeat="row in fromObj.tab track by $index">
                        <div>标题--(写汉字)<input type="text" placeholder="请输入" style="width:250px;" ng-model="row.title"></div>
                        <div>链接--(写路由name)<input type="text" placeholder="请输入" style="width:150px;" ng-model="row.link"></div>
                        <div>是否本页面--(请自行选中一个)<input type="checkbox" name="tabName" ng-model="row.me" value="true"></div>
                        <div>删除本条目 <i class="fa fa-close" style="color:#F44336;" ng-click="removeItem('tab', $index)"></i> </div>
                    </div>
                </div>
                搜索框属性<span style="color:#4CAF50;" ng-click="addItem('search')"> <i class="fa fa-plus"></i> </span>
                <div class="makeTable15List2">
                    <div class="makeTable15ListItem" ng-repeat="row in fromObj.search track by $index">
                        <div>标题--(请写汉字) <input type="text" placeholder="请输入" style="width:150px;" ng-model="row.name"></div>
                        <div>字段--(根据文档) <input type="text" placeholder="请输入" style="width:150px;" ng-model="row.title"></div>
                        <div>类型 <select placeholder="请输入" style="width:100px;" ng-model="row.type">
                            <option value="日期范围">日期范围</option>
                            <option value="日期">日期</option>
                            <option value="下拉框">下拉框</option>
                            <option value="文本框">文本框</option>
                        </select> </div>
                        <div ng-if="row.type=='下拉框'">下拉框--??????? <input type="checkbox" ng-model="row.dropSearch"></div>
                        <div ng-if="row.type=='下拉框'">下拉框--对应接口 <input type="text" placeholder="请输入" style="width:150px;" ng-model="row.api"></div>
                        <div>删除本条目 <i style="color:#F44336;" class="fa fa-close" title="关闭" ng-click="removeItem('search', $index)"></i> </div>
                    </div>
                </div>
                搜索附加功能按钮<span style="color:#4CAF50;" ng-click="addItem('searchBtn')"> <i class="fa fa-plus"></i> </span>
                <div class="makeTable15List3">
                    <div class="makeTable15ListItem" ng-repeat="row in fromObj.searchBtn track by $index">
                        <div>标题--(请写汉字) <input type="text" placeholder="请输入" style="width:150px;" ng-model="row.title"></div>
                        <div>字段--(随便) <input type="text" placeholder="请输入" style="width:150px;" ng-model="row.name"></div>
                        <div>按钮功能类型 <select placeholder="请输入" style="width:100px;" ng-model="row.func">
                            <option value="确认">二次确认</option>
                            <option value="跳转">跳转</option>
                            <option value="下载">下载</option>
                            <option value="弹框">弹框</option>
                        </select> </div>
                        <div>删除本条目 <i class="fa fa-close" style="color:#F44336;" ng-click="removeItem('searchBtn', $index)"></i> </div>
                    </div>
                </div>
                <textarea style="width:100%" cols="20" rows="10" ng-model="splitDemo"></textarea>
                <div>解析接口文档 提取有用的内容 <i class="fa fa-close" style="color:#F44336;" ng-click="splitDemo1f()"></i> </div>
                表格列<span style="color:#4CAF50;" ng-click="addItem('tableColume')"> <i class="fa fa-plus"></i> </span>
                <div class="makeTable15List4">
                    <div class="makeTable15ListItem" ng-repeat="row in fromObj.tableColume track by $index">
                        <div>列名--(请写汉字) <input type="text" placeholder="请输入" style="width:150px;" ng-model="row.name"></div>
                        <div>字段--(根据文档) <input type="text" placeholder="请输入" style="width:150px;" ng-model="row.title"></div>
                        <div>列类型 <select placeholder="请输入" style="width:100px;" ng-model="row.type">
                            <option value="文本">文本</option>
                            <option value="选择">选择</option>
                        </select> </div>
                        <div>列假数据 <select placeholder="请输入" style="width:100px;" ng-model="row.mock">
                            <option value="日期">日期</option>
                            <option value="名字">名字</option>
                            <option value="词语">词语</option>
                            <option value="id">id</option>
                            <option value="网址">网址</option>
                            <option value="数字">数字</option>
                            <option value="金钱">金钱</option>
                            <option value="枚举2">枚举2</option>
                            <option value="枚举3">枚举3</option>
                        </select> </div>
                        <div ng-if="row.type=='选择'" >列选项 <input type="text" placeholder="请输入" style="width:300px;" ng-model="row.option"></div>
                        <div>是否要汇总 <input type="checkbox" ng-model="row.sum"></div>
                        <div>删除本条目 <i class="fa fa-close" style="color:#F44336;" ng-click="removeItem('tableColume', $index)"></i> </div>
                    </div>
                </div>
                操作列<span style="color:#4CAF50;" title="添加" ng-click="addItem('opBtn')"> <i class="fa fa-plus"></i> </span>
                <div class="makeTable15List5">
                    <div class="makeTable15ListItem" ng-repeat="row in fromObj.opBtn track by $index">
                        <div> 操作列字段<input type="text" placeholder="请输入" style="width:150px;" ng-model="row.title"></div>
                        <div> 操作列名称<input type="text" placeholder="请输入" style="width:150px;" ng-model="row.name"></div>
                        <div> 操作列功能类型<select placeholder="请输入" style="width:100px;" ng-model="row.func">
                            <option value="确认">二次确认</option>
                            <option value="跳转">跳转</option>
                            <option value="下载">下载</option>
                            <option value="弹框">弹框</option>
                            <option value="删除">删除</option>
                            <option value="改状态">改状态</option>
                        </select> </div>
                        <div>删除本条目 <i class="fa fa-close" style="color:#F44336;" ng-click="removeItem('opBtn', $index)"></i> </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <textarea style="width: 100%;height: 1189px; background: #FFEB3B; border: 1px solid red;">
                    {'0':'', '1':'', '2':''}
                </textarea>
            </div>
        </div>
    </form>
    <button class="btn btn-success" ng-click="produceCode()"> <i class="glyphicon glyphicon-plus"></i>生产表格代码 </button>
    <button class="btn btn-danger" ng-click="makeCodeFile()"> <i class="glyphicon glyphicon-plus"></i>生产文件 (需要服务器配合) </button>
    <button class="btn btn-danger" ng-click="printFromObj()"> 打印当前 json </button>
    <button class="btn btn-success" ng-click="getFromObj()"> 接收 console/localstorage 中的 json </button>
    <button class="btn btn-success" ng-disabled="!fangdai" ng-click="setFromObj()"> 恢复以往版本json </button>
    <select placeholder="请选择" style="width:250px;" ng-model="fangdai"> <option ng-repeat="row in fangdaiArr track by $index" value="{{row.name}}">{{ row.name }}</option> </select>
    <uib-tabset class="tab-container">
        <uib-tab heading="生成的表格 预览">
            <div class="yxt14" id="jsonMakeTable"></div>
        </uib-tab>
        <uib-tab heading="生成的表格 dom">
            <pre id="templateH"></pre>
        </uib-tab>
        <uib-tab heading="生成的表格 Js">
            <pre>app.controller('controllerName', function ($scope, $rootScope, $timeout, $stateParams, $state, $uibModal, yxtable14, $alert, $API, $go) {})</pre>
            <pre id="templateJ"></pre>
        </uib-tab>
        <uib-tab heading="生成的API code">
            <pre id="templateA"></pre>
        </uib-tab>
        <uib-tab heading="生成的接口文档">
            <pre id="templateAPI"></pre>
        </uib-tab>
        <uib-tab heading="JSON code">
            <dc-json json="fromObj" collapsed="true"></dc-json>
        </uib-tab>
    </uib-tabset>
</div>
